using System;
using System.Collections.Generic;
using Managistics.Model;

namespace Managistics.Core.Services
{
    public interface IPurchaseReportService
    {
        /// <summary>
        /// Get all purchases ordered detail
        /// </summary>
        /// <param name="parameters">Managistics.Core.Services.PurchaseReportsVO<param>
        /// <returns></returns>
        Tuple<IList<PurchaseOrderReport>, IList<PurchaseOrderedTotalRecord>> GetPurchaseOrderedDetail(PurchaseReportsVO parameters);

        /// <summary>
        /// Get all purchase inputed detail
        /// </summary>
        /// <param name="parameters">Managistics.Core.Services.PurchaseReportsVO<param>
        /// <returns></returns>
        Tuple<IList<PurchaseInputReport>, IList<PurchaseInputedTotalRecord>> GetPurchaseInputedDetail(PurchaseReportsVO parameters);

        /// <summary>
        /// Get Backlog detail
        /// </summary>
        /// <param name="parameters">Managistics.Core.Services.PurchaseReportsVO<param>
        /// <returns></returns>
        Tuple<IList<PurchaseInputReport>, IList<PurchaseBacklogTotalRecord>> GetPurchaseBacklogDetail(PurchaseReportsVO parameters);

        /// <summary>
        /// Get Purchase Non Input detail
        /// </summary>
        /// <param name="parameters">Managistics.Core.Services.PurchaseReportsVO</param>
        /// <returns></returns>
        Tuple<IList<PurchaseInputReport>, IList<PurchaseInputedTotalRecord>> GetPurchaseNonInputDetail(PurchaseReportsVO parameters);
    }

    # region Result objects

    public class PurchaseOrderedTotalRecord
    {
        public string ObjectId { get; set; }
        public string ObjectName { get; set; }
        public float? SumOrderQuantity { get; set; }
        public float? SumOrderPriceVat { get; set; }
    }

    public class PurchaseInputedTotalRecord
    {
        public string ObjectId { get; set; }
        public string ObjectName { get; set; }
        public float? SumOrderQuantity { get; set; }
        public float? SumOrderPrice { get; set; }
        public float? SumInputedQuantity { get; set; }
        public float? SumInputedPrice { get; set; }
        public float? SumExistingQuantity { get; set; }
        public float? SumExistingPrice { get; set; }
    }

    public class PurchaseBacklogTotalRecord
    {
        public string ObjectId { get; set; }
        public string ObjectName { get; set; }
        public float? SumBacklogQuantity { get; set; }
        public float? SumBacklogPrice { get; set; }
    }

    # endregion

    # region Parameter object from view PurchaseReportsView

    public class PurchaseReportsVO
    {
        /// <param name="reportBy">The parameter of report by good or supplier</param>
        /// <param name="startDate">The parameter of start ordered date of purchase</param>
        /// <param name="endDate">The parameter of end ordered date of purchase</param>
        /// <param name="goodCode">The parameter of good code or all goods</param>
        /// <param name="inputType">Type of input sheet</param>
        /// <param name="supplierCode">The parameter for getting all supplier or one supplier</param>
        public int ReportBy { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public string GoodCode { get; set; }
        public string SupplierCode { get; set; }
        public int InputType { get; set; }
    }

    # endregion
}